home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-23 | 1.4 KB | 74 lines | [TEXT/PJMM] |
- { TransSkel button application in Pascal }
-
- { 10 Feb 94 Version 1.00, Paul DuBois }
-
- program Button;
-
- uses
- TransSkel, ButtonGlobals, Dialog1, Dialog2, Dialog3, Document;
-
-
- {--------------------------------------------------------------------}
- { Menu handling procedures }
- {--------------------------------------------------------------------}
-
-
- { Handle selection of "About Button..." item from Apple menu }
-
- procedure DoAppleMenu (item: Integer);
- var
- ignore: Integer;
- begin
- ignore := SkelAlert(aboutAlrtRes, SkelDlogFilter(nil, true), skelPositionOnParentDevice);
- SkelRmveDlogFilter;
- end;
-
-
- { Process selection from File menu }
-
- procedure DoFileMenu (item: Integer);
- const
-
- doDialog1Item = 1;
- doDialog2Item = 2;
- doDialog3Item = 3;
- { sepLine }
- quitAppItem = 5;
- begin
- case item of
- doDialog1Item:
- DoDialog1;
- doDialog2Item:
- DoDialog2;
- doDialog3Item:
- DoDialog3;
- quitAppItem:
- SkelStopEventLoop;
- end;
- end;
-
-
- { Initialize menus. Tell TransSkel to process the Apple menu }
- { automatically, and associate the proper procedures with the }
- { File menu. }
-
- procedure SetupMenus;
- var
- m: MenuHandle;
- ignore: Boolean;
- begin
- SkelApple('About Button…', @DoAppleMenu);
- m := GetMenu(fileMenuRes);
- ignore := SkelMenu(m, @DoFileMenu, nil, false, true);
- end;
-
-
- begin
- SkelInit(nil);
- horizRatio := FixRatio(1, 2);
- vertRatio := FixRatio(1, 5);
- SetupMenus;
- SetupDocument;
- SkelEventLoop;
- SkelCleanup;
- end.